package xcmg.device.dao.mapper.warehouse;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import xcmg.device.dao.entity.warehouse.WarehouseAreaDO;
import xcmg.device.dao.entity.warehouse.WarehouseInOutBaseDO;
import xcmg.device.dao.entity.warehouse.WarehouseInboundRecordDO;
import xcmg.device.service.vo.warehouse.WarehouseInOutBaseVO;
import xcmg.device.service.vo.warehouse.WarehouseInboundRecordVO;

import java.util.List;

@Mapper
public interface WarehouseInboundRecordMapper {
    int insert(WarehouseInboundRecordDO record);

    int updateByPrimaryKeySelective(WarehouseInboundRecordDO record);

    List<WarehouseInboundRecordDO> findByInboundOrder(@Param("inboundOrder") String inboundOrder, @Param("orgId") String orgId);

    int deleteByInboundOrder(@Param("inboundOrder") String inboundOrder, @Param("orgId") String orgId);

    List<WarehouseInboundRecordDO> list(WarehouseInboundRecordVO model);

    int deleteByPrimaryKey(String id);

    int removeByInOrderList(@Param("orderList") List<String> orderList, @Param("orgId") String orgId);

    int remove(@Param("ids") List<String> ids);

    WarehouseInboundRecordDO findByBarcode(@Param("barCode") String barCode, @Param("orgId") String orgId);

    int findCountForExportAll(WarehouseInboundRecordVO model);

    List<WarehouseInboundRecordDO> findByIds(@Param("ids") List<String> ids);

    int updateByLocation(WarehouseInboundRecordDO record);

    List<WarehouseInOutBaseDO> findAllInOut(WarehouseInOutBaseVO model);
    
    List<WarehouseInOutBaseDO> findAllInOutNotPackaged(WarehouseInOutBaseVO model);

    List<WarehouseInOutBaseDO> findAllInOutGroup(WarehouseInOutBaseVO model);

    int findCountForAllInOut(WarehouseInOutBaseVO model);

    List<WarehouseAreaDO> getSapCodeByNo(@Param("orgId")String orgId,@Param("businessOrder")String businessOrder,
                                         @Param("materialNo")String materialNo);

    int removeByBarcodeList(@Param("barcodeList") List<String> barcodeList, @Param("orgId") String orgId);
}
